package steps
{
	import jnBase.BaseZhishi;
	import jnBase.Data;
	import jnBase.InsPages;
	import jnBase.PSteps;
	
	import laya.display.Sprite;
	import laya.utils.Handler;
	import laya.utils.Tween;
	
	import ui.steps.step6_dilanUI;
	
	public class Step06_DiLan extends step6_dilanUI implements InsPages
	{
		public var _scriptPage:PSteps;
		public var _scriptZhishi:BaseZhishi;
		private var zhishiStr:String="";
		public function Step06_DiLan()
		{
			super();
			size(1920,1080);
			this.name="6.底栏";
			_scriptPage=this.addComponent(PSteps);
			_scriptZhishi=this.addComponent(BaseZhishi);
		}
		public function changeSonStep():void
		{
			switch(Data.currSonStep)
			{
				case 0:
				{
					step1();
					break;
				}
				case 1:
				{
					step2();
					break;
				}
				case 2:
				{
					step3();
					break;
				}
				case 3:
				{
					step4();
					break;
				}
				case 4:
				{
					step5();
					break;
				}
				default:
				{
					break;
				}
			}
			
		}
		
		
		private function step1():void
		{
			// TODO Auto Generated method stub
			x1.alpha=x2.alpha=x3.alpha=n1.alpha=n2.alpha=b1.alpha=b2.alpha=b3.alpha=b4.alpha=b5.alpha=b6.alpha=b7.alpha=z1.alpha=z2.alpha=T1.alpha=S1.alpha=Q1.alpha=0;
			xueyaBox.visible=niaoBox.visible=zongBox.visible=false;
			_scriptZhishi.showTips("底栏的内容包括血压、入量、尿量、大便次数、体重、身高及其他等，以阿拉伯数字记录，免写计量单位，用蓝(黑)钢笔填写在相应栏内");
			
			Laya.timer.once(5000,this,function():void{
				_scriptZhishi.showTips("血压:以毫米汞柱(mmHg)为单位填入,记录方式：收缩压/舒张压");
				_scriptZhishi.xiankuangClick(676,395,104,36,function():void{
					_scriptZhishi.clearLoop();
					_scriptZhishi.hideLine();
					Tween.to(x1,{alpha:1},500);
					Laya.timer.once(2000,this,function():void{
						_scriptZhishi.showTips("若一日内连续测量血压时，则上午血压写在前半格内，下午血压写在后半格内；术前血压写在前面，术后血压写在后面");
						_scriptZhishi.xiankuangClick(676,395,104,36,function():void{
							_scriptZhishi.clearLoop();
							_scriptZhishi.hideLine();
							Tween.to(x2,{alpha:1},500);
							Laya.timer.once(2000,this,function():void{
								_scriptZhishi.showTips("如为下肢血压应当标注");
								_scriptZhishi.xiankuangClick(776,395,104,36,function():void{
									_scriptZhishi.clearLoop();
									_scriptZhishi.hideLine();
									Tween.to(x3,{alpha:1},500);
									Laya.timer.once(2000,this,function():void{
										_scriptZhishi.showTips("新入院病人应记录血压，根据病人病情及医嘱测量并记录");
										Laya.timer.once(2000,this,function():void{
											xueyaBox.visible=true;
											Laya.timer.once(2000,this,function():void{
												_scriptPage.showSonStepByIndex(1);
											});
										});
										
									});
								});
								
							});
						});
						
					});
				});
			});
		}
		private function step2():void
		{
			// TODO Auto Generated method stub
			x1.alpha=x2.alpha=x3.alpha=1;
			n1.alpha=n2.alpha=b1.alpha=b2.alpha=b3.alpha=b4.alpha=b5.alpha=b6.alpha=b7.alpha=z1.alpha=z2.alpha=T1.alpha=S1.alpha=Q1.alpha=0;
			
			xueyaBox.visible=true;
			niaoBox.visible=zongBox.visible=false;
			_scriptZhishi.showTips("尿量:以毫升(ml)为单位，记前一日24小时的尿液总量，每天记录1次");
			Laya.timer.once(4000,this,function():void{
				_scriptZhishi.showTips("排尿符号：导尿以“C”表示；例如：“1500/C”表示导尿病人排尿1500ml");
				_scriptZhishi.xiankuangClick(677,426,104,36,function():void{
					_scriptZhishi.clearLoop();
					_scriptZhishi.hideLine();
					Tween.to(n1,{alpha:1},500);
					Laya.timer.once(4000,this,function():void{
						_scriptZhishi.showTips("尿失禁以※表示");
						_scriptZhishi.xiankuangClick(776,426,104,36,function():void{
							_scriptZhishi.clearLoop();
							_scriptZhishi.hideLine();
							Tween.to(n2,{alpha:1},500);
							Laya.timer.once(2000,this,function():void{
								niaoBox.visible=true;
								Laya.timer.once(2000,this,function():void{
									_scriptPage.showSonStepByIndex(2);
								});
							});
						});
					});
				});
				
			});
		}
		private function step3():void
		{
			// TODO Auto Generated method stub
			x1.alpha=x2.alpha=x3.alpha=n1.alpha=n2.alpha=1;
			b1.alpha=b2.alpha=b3.alpha=b4.alpha=b5.alpha=b6.alpha=b7.alpha=z1.alpha=z2.alpha=T1.alpha=S1.alpha=Q1.alpha=0;
			xueyaBox.visible=niaoBox.visible=true;
			zongBox.visible=false;
			_scriptZhishi.showTips("记前一日的大便次数，每天记录1次");
			Laya.timer.once(3000,this,function():void{
				_scriptZhishi.showTips("大便符号：未解大便以“0”表示");
				_scriptZhishi.xiankuangClick(676,458,104,36,function():void{
					_scriptZhishi.clearLoop();
					_scriptZhishi.hideLine();
					Tween.to(b1,{alpha:1},500);
					Tween.to(b2,{alpha:1},1000);
					_scriptZhishi.showTips("大便失禁以“※”表示");
					_scriptZhishi.xiankuangClick(879,457,104,36,function():void{
						_scriptZhishi.clearLoop();
						_scriptZhishi.hideLine();
						Tween.to(b3,{alpha:1},1500);
						_scriptZhishi.showTips("人工肛门以“☆”表示");
						_scriptZhishi.xiankuangClick(978,456,104,36,function():void{
							_scriptZhishi.clearLoop();
							_scriptZhishi.hideLine();		
							Tween.to(b4,{alpha:1},2000);
							Laya.timer.once(1500,this,function():void{
								_scriptZhishi.showTips("灌肠以“E”表示，灌肠后排便以E作分母、排便作分子表示，例如，“1/E”表示灌肠后排便1次；");
								Laya.timer.once(2500,this,function():void{
									_scriptZhishi.xiankuangClick(1080,456,104,36,function():void{
										_scriptZhishi.clearLoop();
										_scriptZhishi.hideLine();
										Tween.to(b5,{alpha:1},500);
										Laya.timer.once(1500,this,function():void{
											_scriptZhishi.showTips("“1²/ᴇ”表示自行排便1次，灌肠后又排便2次；");
											Laya.timer.once(2500,this,function():void{
												_scriptZhishi.xiankuangClick(1183,456,104,36,function():void{
													_scriptZhishi.clearLoop();
													_scriptZhishi.hideLine();
													Tween.to(b6,{alpha:1},500);
													Laya.timer.once(1500,this,function():void{
														_scriptZhishi.showTips("“⁴/2ᴇ”表示灌肠2次后排便4次");
														Laya.timer.once(2500,this,function():void{
															_scriptZhishi.xiankuangClick(1286,456,104,36,function():void{
																_scriptZhishi.clearLoop();
																_scriptZhishi.hideLine();
																Tween.to(b7,{alpha:1},500);
																Laya.timer.once(2500,this,function():void{
																	_scriptPage.showSonStepByIndex(3);
																});
															});
														});
													});
												});
											});
										});
									});
								});
							});
						});
					});
				});
			});
		}
		private function step4():void
		{
			// TODO Auto Generated method stub
			x1.alpha=x2.alpha=x3.alpha=n1.alpha=n2.alpha=b1.alpha=b2.alpha=b3.alpha=b4.alpha=b5.alpha=b6.alpha=b7.alpha=1;
			z1.alpha=z2.alpha=T1.alpha=S1.alpha=Q1.alpha=0;
			zongBox.visible=false;
			xueyaBox.visible=niaoBox.visible=true;
			_scriptZhishi.showTips("入量/出量 以毫升(ml)为单位，记前一日24小时的总入量/总出量在相应的日期栏内，每天记录1次。");
			Laya.timer.once(2000,this,function():void{
				_scriptZhishi.xiankuangClick(676,491,104,57,function():void{
					_scriptZhishi.clearLoop();
					_scriptZhishi.hideLine();
					Tween.to(z1,{alpha:1},500);
					Tween.to(z2,{alpha:1},1000);
					Laya.timer.once(2000,this,function():void{
						zongBox.visible=true;
						Laya.timer.once(2500,this,function():void{
							_scriptPage.showSonStepByIndex(4);
						});
					});
				});
			});
		}
		private function step5():void
		{
			x1.alpha=x2.alpha=x3.alpha=n1.alpha=n2.alpha=b1.alpha=b2.alpha=b3.alpha=b4.alpha=b5.alpha=b6.alpha=b7.alpha=z1.alpha=z2.alpha=1;
			xueyaBox.visible=niaoBox.visible=zongBox.visible=true;
			T1.alpha=T2.alpha=S1.alpha=S2.alpha=Q1.alpha=0;
			_scriptZhishi.showTips("体重以千克(kg)为单位填入。一般新入院病人当日应测量体重并记录。");
			Laya.timer.once(2500,this,function():void{
				_scriptZhishi.xiankuangClick(678,547,101,33,function():void{
					_scriptZhishi.clearLoop();
					_scriptZhishi.hideLine();
					Tween.to(T1,{alpha:1},500);
					_scriptZhishi.showTips("病情危重或卧床不能测量的病人，应在体重栏内注明“卧床”");
					_scriptZhishi.xiankuangClick(778,546,101,33,function():void{
						_scriptZhishi.clearLoop();
						_scriptZhishi.hideLine();
						Tween.to(T2,{alpha:1},500);
						Laya.timer.once(2500,this,function():void{
							_scriptZhishi.showTips("身高以厘米(cm)为单位填入，一般新入院病人当日应测量身高并记录");
							_scriptZhishi.xiankuangClick(678,579,101,33,function():void{
								_scriptZhishi.clearLoop();
								_scriptZhishi.hideLine();
								Tween.to(S1,{alpha:1},500);
								_scriptZhishi.showTips("病情危重或卧床不能测量的病人，应在体重栏内注明“卧床”");
								_scriptZhishi.xiankuangClick(778,577,101,33,function():void{
									_scriptZhishi.clearLoop();
									_scriptZhishi.hideLine();
									Tween.to(S2,{alpha:1},500);
									Laya.timer.once(2500,this,function():void{
										_scriptZhishi.showTips("“其他”栏作为机动，根据病情需要填写，如特殊用药、腹围、药物过敏试验、记录管路情况等。");
										_scriptZhishi.xiankuangClick(678,610,101,33,function():void{
											_scriptZhishi.clearLoop();
											_scriptZhishi.hideLine();
											Tween.to(Q1,{alpha:1},500);
											Laya.timer.once(2500,this,function():void{
												_scriptPage.endShiyan();
											});
										});
									});
								});
							});
						});
					});
				});
			});
		}
		/**
		 *切换二级菜单时自动调用
		 * 显示新的二级页面时会自动调用此方法 
		 * 
		 */		
		public function reset():void
		{
			_scriptZhishi.hideAll();
			removeAllListener();
			zhishiStr="";
		}
		/**
		 *移除所有监听 
		 * 
		 */		
		public function removeAllListener():void
		{
			_scriptZhishi.removeAllHandler();	
		}
		override public function onEnable():void{
			reset();
		}
		/**
		 *关闭时自动调用 
		 * @param type
		 * 
		 */		
		override public function close(type:String=null):void
		{
			// TODO Auto Generated method stub
			_scriptPage.enabled=false;
			_scriptZhishi.enabled=false;
			removeAllListener();
			Tween.to(this,{x:-GameConfig.width,alpha:0},300,null,Handler.create(this,closeSuper,[type]));
		}
		private function closeSuper(type:String=null):void{
			super.close(type);
		}
		/**
		 *每秒执行一次 
		 * 
		 */		
		public function lineLoop():void
		{
			// TODO Auto Generated method stub
			if(zhishiStr==""){
				_scriptZhishi.zhishiRect.alpha=1;
				Tween.to(_scriptZhishi.zhishiRect,{alpha:0.1},600);
			}
			else if(zhishiStr=="xi"){
				_scriptZhishi.mdown.visible=true;
				_scriptZhishi.mdown.pos(958,688);
				_scriptZhishi.mdown.rotation=-155;
				Tween.to(_scriptZhishi.mdown,{x:990,y:596},600);
			}
		}
		/**
		 *被移除时自动调用  
		 * 因为设置了自动销毁，所以关闭后后会执行销毁 ，因为关闭时加了一个动画，所以要300毫秒后才执行销毁
		 * 
		 */		
		override public function onDestroy():void{
			trace(this.name+"销毁");
		}
	}
}